package com.one.service;

import com.one.util.RequestReturn;
import com.one.vo.WechatUser;
import org.springframework.cloud.netflix.feign.FeignClient;
import org.springframework.web.bind.annotation.*;

import javax.servlet.http.HttpServletRequest;
import java.util.Map;

/**
 * @Author ShiWen
 * @date 2022/1/14 12:26
 * @Version 1.0
 * @Description TODO
 */
@FeignClient(name = "street-login")
public interface LoginService {

    @PostMapping("/login/doLogin")
    RequestReturn<Map<String,Object>> phoneDoLogin(@RequestParam("phone") String phone, @RequestParam("password") String password);

    /**
     *  使用手机验证码登录+注册
     */
    @PostMapping("/login/phoneAuth")
    RequestReturn<Map<String,Object>> phoneAuth(@RequestParam("phone") String phone,@RequestParam("auth") String auth);

    /**
     *  生成短信验证码
     */
    @GetMapping("/login/sendCode")
    RequestReturn<Map<String,Object>> sendAuthCode(@RequestParam("phone") String phone);

    // 查看验证码
    @GetMapping("/login/queryCode")
    RequestReturn<Map<String,Object>> selectAuthCode(@RequestParam("phone") String phone);
    /**
     *  微信注册绑定手机号
     */
    @GetMapping("/login/bindingPhone")
    RequestReturn<Map<String,Object>> bindingPhone(@RequestParam("wechatUser") String wechatUser,
                                       @RequestParam("phone") String phone,
                                       @RequestParam("auth") String auth);
    /**
     *  请求微信获取请求微信公众测试平台，手动授权，获取code的连接（完整url）
     */
    @GetMapping("/codeUrl")
    RequestReturn<Map<String,Object>> wechatAuthCodeUrl();
}
